Trable s ikonou
Otázka od: Jaromir Cermak
7. 4. 2004 10:22
Ahoj vsichni
Mam nasledujici problem. Vytvrim komponentu Edit se SpeedButtonem. Do prislusne
unity jsem prilinkoval resourece file s ikonou (16x16, 16 barev) baterky, ktera
ma svitit na tom buttonu. Kdyz ale ikonu natahnu do Buttonu (dale opsanym kusem
kodu], cela se jaksi zvetsi a nevypada to pekne. Prosim poradte. Zajimalo by me
co delam spatne, nebo jak to opravit.
Kod:
FButton:=TSpeedButton.Create(Self);
FButton.SetBounds(0, 0, FBtnControl.Width, FBtnControl.Height);
FButton.Parent:=FBtnControl;
FButton.Width:=25;
FButton.Height:=25;
lIcon:=TIcon.Create;
lIcon.Handle:=LoadIcon(HInstance,'BATERKA');
lPicture:=TPicture.Create;
lPicture.Icon:=lIcon;
FButton.Glyph:=TBitmap.Create;
FButton.Glyph.Width:=lIcon.Width;
FButton.Glyph.Height:=lIcon.Height;
FButton.Glyph.Canvas.Draw(0,0,lPicture.Graphic);
lIcon.Free;
lPicture.Free;
FButton.Refresh;
FButton.NumGlyphs:=1;
Jaromir Cermak